/**
 * Beauty医美分期系统 - 统一样式
 * 包含公共背景、卡片、表格、状态等样式
 */

// ==================== 颜色变量 ====================
$beauty-primary: #409eff;
$beauty-success: #67c23a;
$beauty-warning: #e6a23c;
$beauty-danger: #f56c6c;
$beauty-info: #909399;

$beauty-bg-color: #f5f7fa;
$beauty-border-color: #dcdfe6;
$beauty-text-primary: #303133;
$beauty-text-regular: #606266;
$beauty-text-secondary: #909399;

// ==================== 页面容器样式 ====================
.beauty-container {
  padding: 8px;
  background-color: $beauty-bg-color;
  min-height: calc(100vh - 84px);
}

// ==================== 卡片样式 ====================
.beauty-card {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  margin-bottom: 16px;

  &-header {
    padding: 16px 20px;
    border-bottom: 1px solid $beauty-border-color;
    font-size: 16px;
    font-weight: 600;
    color: $beauty-text-primary;
  }

  &-body {
    padding: 20px;
  }
}

// ==================== 搜索表单样式 ====================
.beauty-search {
  background: #fff;
  padding: 16px;
  border-radius: 4px;
  margin-bottom: 10px;

  .el-form {
    .el-form-item {
      margin-bottom: 12px;
    }
  }
}

// ==================== 工具栏样式 ====================
.beauty-toolbar {
  margin-bottom: 16px;

  .el-button {
    + .el-button {
      margin-left: 8px;
    }
  }
}

// ==================== 表格样式 ====================
.beauty-table {
  .el-table {
    font-size: 14px;

    th {
      background-color: #fafafa;
      color: $beauty-text-primary;
      font-weight: 600;
    }

    td {
      color: $beauty-text-regular;
    }

    // 行悬停效果
    .el-table__body tr:hover > td {
      background-color: #f5f7fa !important;
    }

    // 状态标签样式
    .status-tag {
      font-size: 12px;
      padding: 2px 8px;
      border-radius: 2px;
    }
  }

  // 分页样式
  .pagination-container {
    margin-top: 16px;
    text-align: right;
  }
}

// ==================== 表格行高亮样式 ====================
// 逾期行
:deep(.overdue-row) {
  background-color: #fef0f0 !important;

  &:hover > td {
    background-color: #fde2e2 !important;
  }

  .overdue-text {
    color: $beauty-danger;
    font-weight: bold;
  }
}

// 警告行
:deep(.warning-row) {
  background-color: #fdf6ec !important;

  &:hover > td {
    background-color: #faecd8 !important;
  }
}

// 成功行
:deep(.success-row) {
  background-color: #f0f9ff !important;

  &:hover > td {
    background-color: #e1f3ff !important;
  }
}

// ==================== 对话框样式 ====================
.beauty-dialog {
  .el-dialog__header {
    border-bottom: 1px solid $beauty-border-color;
    padding: 16px 20px;
  }

  .el-dialog__body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
  }

  .el-dialog__footer {
    border-top: 1px solid $beauty-border-color;
    padding: 12px 20px;
    text-align: right;
  }

  // 描述列表样式
  .el-descriptions {
    &__label {
      font-weight: 600;
      color: $beauty-text-regular;
    }

    &__content {
      color: $beauty-text-primary;
    }
  }
}

// ==================== 统计卡片样式 ====================
.beauty-statistics {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;

  &-card {
    flex: 1;
    background: #fff;
    border-radius: 4px;
    padding: 20px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;

    &:hover {
      transform: translateY(-4px);
      box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.15);
    }

    &-title {
      font-size: 14px;
      color: $beauty-text-secondary;
      margin-bottom: 12px;
    }

    &-value {
      font-size: 28px;
      font-weight: bold;
      color: $beauty-text-primary;

      &.primary {
        color: $beauty-primary;
      }

      &.success {
        color: $beauty-success;
      }

      &.warning {
        color: $beauty-warning;
      }

      &.danger {
        color: $beauty-danger;
      }

      &.info {
        color: $beauty-info;
      }
    }

    &-icon {
      font-size: 40px;
      opacity: 0.2;
      float: right;
      margin-top: -10px;
    }
  }
}

// ==================== 文本样式工具类 ====================
.text-primary {
  color: $beauty-text-primary !important;
}

.text-regular {
  color: $beauty-text-regular !important;
}

.text-secondary {
  color: $beauty-text-secondary !important;
}

.text-success {
  color: $beauty-success !important;
}

.text-warning {
  color: $beauty-warning !important;
}

.text-danger {
  color: $beauty-danger !important;
}

.text-info {
  color: $beauty-info !important;
}

// ==================== 字体工具类 ====================
.font-bold {
  font-weight: bold !important;
}

.font-normal {
  font-weight: normal !important;
}

.text-sm {
  font-size: 12px !important;
}

.text-base {
  font-size: 14px !important;
}

.text-lg {
  font-size: 16px !important;
}

.text-xl {
  font-size: 18px !important;
}

// ==================== 金额显示样式 ====================
.beauty-amount {
  color: $beauty-danger;
  font-weight: 600;
  font-family: 'Courier New', monospace;

  &::before {
    content: '¥';
    margin-right: 2px;
  }

  &.large {
    font-size: 20px;
  }

  &.small {
    font-size: 12px;
  }
}

// ==================== 图片预览样式 ====================
.beauty-images {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;

  .el-image {
    width: 100px;
    height: 100px;
    border-radius: 4px;
    border: 1px solid $beauty-border-color;
    cursor: pointer;
    transition: transform 0.3s ease;

    &:hover {
      transform: scale(1.05);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
  }

  &.large .el-image {
    width: 200px;
    height: 200px;
  }

  &.small .el-image {
    width: 60px;
    height: 60px;
  }
}

// ==================== 标签组样式 ====================
.beauty-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;

  .el-tag {
    cursor: default;
  }
}

// ==================== 空状态样式 ====================
.beauty-empty {
  padding: 60px 0;
  text-align: center;
  color: $beauty-text-secondary;

  &-icon {
    font-size: 64px;
    color: $beauty-info;
    opacity: 0.3;
    margin-bottom: 16px;
  }

  &-text {
    font-size: 14px;
  }
}

// ==================== 加载样式 ====================
.beauty-loading {
  padding: 40px 0;
  text-align: center;
}

// ==================== 响应式样式 ====================
@media screen and (max-width: 768px) {
  .beauty-container {
    padding: 4px;
  }

  .beauty-card {
    margin-bottom: 8px;
  }

  .beauty-statistics {
    flex-direction: column;

    &-card {
      &-value {
        font-size: 24px;
      }
    }
  }

  .beauty-search {
    padding: 12px;
  }

  .beauty-table {
    .el-table {
      font-size: 12px;
    }
  }
}

// ==================== 打印样式 ====================
@media print {
  .beauty-search,
  .beauty-toolbar,
  .pagination-container {
    display: none !important;
  }

  .beauty-card {
    box-shadow: none;
    border: 1px solid $beauty-border-color;
  }
}
